package cz.data.domain.market.model.entity;

import cz.data.common.base.DataScopeBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import cz.data.domain.market.model.dto.HttpService;
import cz.data.domain.market.model.dto.ServiceReqParam;
import cz.data.domain.market.model.dto.WebService;
import cz.data.domain.market.model.handlers.ServiceReqParamArrayTypeHandler;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "market_service_integration", autoResultMap = true)
public class ServiceIntegrationEntity extends DataScopeBaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "服务编号")
    private String serviceNo;
    @ApiModelProperty(value = "服务名称")
    private String serviceName;
    @ApiModelProperty(value = "服务类型", notes = "1http接口，2webservice接口")
    private String serviceType;
    @ApiModelProperty(value = "http接口")
    @TableField(value = "httpservice_json", typeHandler = JacksonTypeHandler.class)
    private HttpService httpService;
    @ApiModelProperty(value = "webservice接口")
    @TableField(value = "webservice_json", typeHandler = JacksonTypeHandler.class)
    private WebService webService;
    @ApiModelProperty(value = "请求参数")
    @TableField(value = "req_params_json", typeHandler = ServiceReqParamArrayTypeHandler.class)
    private List<ServiceReqParam> reqParams = new ArrayList<>();

}
